fix(container): install libyaml-dev so bundle install can compile psych (#28) - #29
Merged
Merged
Conversation
…ch (#28) Follow-up to v1.9.0 (issue #25). v1.9.0 shipped libyaml-0-2 (runtime lib only) which lets the in-container rubocop/reek/etc. start, but a Rails 7+ project running `bundle install` against its own Gemfile fails because compiling psych 5.x natively needs libyaml's headers. Resolution chain: debug -> irb -> rdoc -> psych (psych compile fails: missing yaml.h) Replace libyaml-0-2 with libyaml-dev in the runtime apt block. libyaml-dev depends on libyaml-0-2 transitively, so the runtime lib is still present; no other change needed in the Ruby builder stage or COPY layout. Also extend tests/smoke-rails.sh with a third assertion: run `bundle install` against the Rails-shaped fixture's Gemfile (which contains `gem 'debug'`) and require 'psych' inside the resulting bundle. The existing fixture already included the right Gemfile shape — only the install step is new. Cleanup: bundle install writes root-owned files into the bind-mounted fixture; the existing host-side `rm -rf` couldn't delete them. Moved the cleanup into a docker run so it executes as root inside the container. Tested: - smoke-rails.sh: all three checks pass (Gemfile parse, lint scope, bundle install + psych load) in ~36s end-to-end against a freshly built image - make _check on dev-toolchain itself: pass Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to v1.9.0 (issue #25). Closes #28.
v1.9.0 shipped `libyaml-0-2` (runtime lib only) which is enough for the in-container rubocop/reek/etc. to start. But a Rails 7+ project that runs `bundle install` against its own Gemfile fails because compiling `psych` 5.x natively needs libyaml's headers. The resolution chain is:
```
debug -> irb -> rdoc -> psych (psych native compile fails: missing yaml.h)
```
Rails 7.1+ projects ship `gem 'debug'` in the dev/test group by default, so this hits everyone.
Change
Single Dockerfile swap: `libyaml-0-2` → `libyaml-dev`. `libyaml-dev` depends on `libyaml-0-2` transitively so the runtime lib is still present; no other change needed in the Ruby builder stage or COPY layout.
Smoke-test extension
`tests/smoke-rails.sh` already creates a Rails-shaped fixture with the right Gemfile (was added in PR #26 for issue #25). Added a third assertion to it:
End-to-end runtime: ~36s against a freshly built image.
Also fixed the smoke test's cleanup trap — `bundle install` writes root-owned files into the bind-mounted fixture, and the host-side `rm -rf` couldn't delete them. Cleanup now runs inside a docker container.
Acceptance criteria from issue #28
Test plan
Recommended next step
Cut a `v1.9.1` patch release once merged (`make release VERSION=1.9.1`). Pure bugfix, patch-bump appropriate.
🤖 Generated with Claude Code